Skip to content

test: add comprehensive E2E authentication tests#117

Closed
jakebromberg wants to merge 3 commits intofeat/better-auth-corefrom
test/e2e-auth-tests
Closed

test: add comprehensive E2E authentication tests#117
jakebromberg wants to merge 3 commits intofeat/better-auth-corefrom
test/e2e-auth-tests

Conversation

@jakebromberg
Copy link
Member

Summary

Adds a comprehensive Playwright E2E test suite for all authentication functionality.

Dependencies

This PR builds on #116 (feat/better-auth-features) and should be merged after it.

Changes

Infrastructure

  • Add Playwright configuration for E2E testing
  • Create reusable page objects for auth flows
  • Implement auth fixtures with session reuse
  • Add helper scripts for E2E test environment

Test Suites

  • Login and logout flows
  • Session navigation and persistence
  • Password reset flows
  • Onboarding for new users
  • Admin role management (promote/demote)
  • User creation and deletion
  • Role-based access control

CI/CD

  • Add GitHub Actions workflow for E2E tests
  • Add CI workflow for lint, typecheck, and unit tests

Test Plan

  • All E2E tests pass locally
  • CI workflow runs successfully

Note

This is PR 3 of 3. Merge order: #115#116 → this PR

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 30, 2026

Deploying wxyc-dj with  Cloudflare Pages  Cloudflare Pages

Latest commit: e11bf9d
Status: ✅  Deploy successful!
Preview URL: https://a8bee099.dj-site.pages.dev
Branch Preview URL: https://test-e2e-auth-tests.dj-site.pages.dev

View logs

Infrastructure:
- Add Playwright configuration for E2E testing
- Create reusable page objects for auth flows
- Implement auth fixtures with session reuse
- Add helper scripts for E2E test environment

Test suites:
- Login and logout flows
- Session navigation and persistence
- Password reset flows
- Onboarding for new users
- Admin role management (promote/demote)
- User creation and deletion
- Role-based access control

CI/CD:
- Add GitHub Actions workflow for E2E tests
- Add CI workflow for lint, typecheck, and unit tests
@jakebromberg jakebromberg changed the base branch from feat/better-auth-features to feat/better-auth-core February 2, 2026 17:45
Add cross-cutting capabilities (editor, webmaster) management:
- Capability toggle chips in roster table for each user
- API endpoint for updating user capabilities
- Updated Account type and BetterAuthUser conversion
- Unit tests for capability handling
@jakebromberg
Copy link
Member Author

Cross-repo coordination

This PR is part of a coordinated change to add cross-cutting capabilities (editor, webmaster) to the auth system:

Repo Change Status
wxyc-shared Phase 1: Capabilities module with types and helpers ✅ Merged to main
Backend-Service Phase 2: Database column, schema, JWT payload WXYC/Backend-Service#143
dj-site Phase 3: Capability management UI in roster 👈 This PR

These should be merged in order: shared → backend → dj-site

Self-service flow:
- Add EmailChangeModal component with password verification
- Update SettingsPopup with read-only email field and change button
- Verification email sent to new address before change takes effect

Admin override flow:
- Add inline email editing to roster AccountEntry
- Admin changes bypass verification (emailVerified: true)
- Confirmation dialog warns about immediate effect

Tests:
- Unit tests for EmailChangeModal (16 tests)
- E2E tests for self-service flow (13 tests)
- E2E tests for admin flow (11 tests)
- New settings.page.ts and roster.page.ts email methods
/**
* Update user capabilities via API
*/
const updateCapabilities = async (newCapabilities: Capability[]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably use redux, which I added in order to avoid performing fetching on components, so that state was reusable. Certainly worth a discussion.

@jakebromberg
Copy link
Member Author

Closing: Superseded. E2E tests will be added in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants